import { Redirect } from 'umi';
import { message } from 'antd';

export default (props: any) => {
  const isLogin = localStorage.getItem('isLogin') === '1';
  if (isLogin) {
    return <div>{props.children}</div>;
  } else {
    message.error('请登录！！！');
    return <Redirect to="/" />;
  }
};
